package xcmg.device.web.warehouse;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import xcmg.device.infra.BasicController;
import xcmg.device.service.vo.warehouse.WarehouseDeliveryDetailVO;
import xcmg.device.service.warehouse.WarehouseDeliveryDetailService;
import yb.ecp.fast.infra.annotation.FastMappingInfo;
import yb.ecp.fast.infra.infra.ActionResult;
import yb.ecp.fast.infra.infra.PageCommonVO;
import yb.ecp.fast.infra.infra.SearchCommonVO;

@RestController
@RequestMapping("/warehouseDeliveryDetail")
public class WarehouseDeliveryDetailController extends BasicController{
    @Autowired
    private WarehouseDeliveryDetailService warehouseDeliveryDetailService;


    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ApiOperation("查询出库详情记录列表")
    @FastMappingInfo(needLogin = true)
    public ActionResult listDeliveryNote(@RequestBody SearchCommonVO<WarehouseDeliveryDetailVO> condition){
        WarehouseDeliveryDetailVO warehouseDeliveryDetailVO =condition.getFilters();
        if(warehouseDeliveryDetailVO == null){
            warehouseDeliveryDetailVO = new WarehouseDeliveryDetailVO();
        }
        condition.setFilters(warehouseDeliveryDetailVO);
        PageCommonVO pageCommonVO= warehouseDeliveryDetailService.list(condition);
        return actionValueResult(pageCommonVO.getPageInfo());
    }
}
